const Response = require("../../class/Response");
// 初始化BDS功能
WSC.get('/bds/init', (wsclient, req, res)=>{
    wsclient.sendJson(Response.replyTo(req)
        .setUrl('/bds/init/result')
        .setData({
            bds: {
                syncType: CONF.CONFIG.get('SyncConfig')['SyncType'],
                uuid: CONF.CONFIG.get('Websocket')['BDSUuid'],
                ip: CONF.CONFIG.get('Websocket')['BDSIp'],
                port: CONF.CONFIG.get('Websocket')['BDSPort'],
                maxPlayersNum: GMLIB_MC.getMaxPlayers(),
                averageTps: GMLIB_MC.getServerAverageTps(),
                mspt: GMLIB_MC.getServerMspt(),
            }
        }),
        (req, res)=>{
            // 客户端注册完成
        }
    );
    return false;
});

WSC.get(CONSTANTS.EVENT.CLIENT_CONNECT, (wsclient, req, res)=>{
    if (req.data.userType != 'bds'){return;}
    if (req.data.bds.uuid != CONF.CONFIG.get('Websocket')['BDSUuid']){return;}
    WSC.client.info = req.data;
});